package com.example.demo.niuke.huawei_b;

import java.util.*;

/**
 * ******************************************************
 *
 * @author liugh9
 * @version 1.0
 * @classname _10简单错误记录
 * @description
 * @date 2023/09/02 8:28
 * <p>
 * ******************************************************
 */
public class _10简单错误记录 {


    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Map<String, Integer> res = new HashMap<>();
        List<String> keys = new LinkedList<>();
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String[] line = in.nextLine().split(" ");
            String path = line[0];
            String number = line[1];
            String filename = path.substring(path.lastIndexOf("\\") + 1);
            if (filename.length() > 16) {
                filename = filename.substring(filename.length() - 16);
            }
            String key = filename + " " + number;
            if (res.containsKey(key)) {
                res.put(key, res.get(key) + 1);
            } else {
                res.put(key, 1);
                keys.add(key);
            }
        }
        for (int i = keys.size() > 8 ? keys.size() - 8 : 0; i < keys.size(); i++) {
            String key = keys.get(i);
            System.out.println(key + " " + res.get(key));
        }
    }
}
